<?php 
// No direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

class csmbolGlobalConf{
	public $release;

	public $factor;
	
	public $client_pending_duration; //seconds;

	public $booking_default_cal_base_user;
	public $booking_default_cal_base_password;

	public $booking_default_cal_user;
	public $booking_default_cal_magicCookie;		
	public $booking_pending_cal_user;
	public $booking_pending_cal_magicCookie;	
	//visit this url to get the uri for existing calendars
	//http://www.google.com/calendar/feeds/default/owncalendars/full	
	public $cal_default_uri;
	public $cal_pending_uri;
	
	public $ph_cal_sg_user;
	public $ph_cal_sg_user_csm;
	public $ph_cal_sg_user_csm_magicCookie;
	
	public $registered_user_gid;
	public $event_organizer_gid;
	public $csm_booking_admin_gid;
	public $admin_gid;
	public $manager_gid;	
	public $super_user_gid;
	public $com_url;	
	
	public $pp_return;
	public $pp_cancel;
	
	public $at_login;
	
	public $noae;
	
	public $current_room;
	public $booking_cal_info;
	public $room_profile;
	
	public $staff;
	
	public $rts_success;
	public $rts_error;
	public $rtmsg_success;
	public $rtmsg_error;
	public $rtmsg_error_cal_down;
	public $rtmsg_error_send_email;	
	public $rtmsg_embeded_code;
	public $rt_csinfo; //customer service info

	function csmbolGlobalConf( $params = array() ){
		// check the serverid is really defined
		$this->noae = 4;
		$this->ph_cal_sg_user = "en.singapore%23holiday@group.v.calendar.google.com";//# must be replaced with %23
		
		$this->rts_success = "success";
		$this->rtmsg_success = "Process returned successfully.";
		$this->rtmsg_embeded_code = "<div><input type=\"button\" value=\"Restart\" class=\"csmbol-btn\" onclick=\"makeNewBooking();\"></div>";
		$this->rts_error = "error";
		$this->rtmsg_error = "<div class=\"csmbol-msg-error\">Error during processing.</div>";
		$this->rtmsg_error_cal_down = "<div class=\"csmbol-msg-error\">Calendar service temporarily unavailable. Please try again later.</div>";		
		$this->rtmsg_error_cal_overheat = "<div class=\"csmbol-msg-error\">Calendar under traffic control. Reduce the batch booking slots (< 6 slots) and try again.</div>";		
		$this->rtmsg_error_send_email = "<div class=\"csmbol-msg-error\">Error sending confirmation email.</div>";			
		$this->rt_csinfo = "<div>For assistance, please contact +65 6338 0566 or enquiry@csm.sg</div>";
		
		$this->booking_cal_info = array();
		$this->room_profile = array();
	
		if ($params["release"]==true){
			$this->factor = 1;
			$this->client_pending_duration = 60; //seconds;
			
			$this->booking_default_cal_base_user = "csmbol.cal@csm.sg";
			$this->booking_default_cal_base_password = "csmbolc1234";
			
			$this->booking_default_cal_user = "csm.sg_jmt3496d2heqlj8gm7du1f9cg0@group.calendar.google.com";//Action Room Calendar ID
			$this->booking_default_cal_magicCookie = "e50efdd8505c37f2923ddafa4bd8d753";		
			$this->booking_pending_cal_user = "csm.sg_61qmjlvbjofnnvt7609lsgbc08@group.calendar.google.com";//action_room_pending Calendar ID
			$this->booking_pending_cal_magicCookie = "9c321f0867e55ced2f520c2e8d96721d";	
			//visit this url to get the uri for existing calendars
			//http://www.google.com/calendar/feeds/default/owncalendars/full	
			$this->cal_default_uri = "http://www.google.com/calendar/feeds/".$this->booking_default_cal_user."/private/full";
			$this->cal_pending_uri = "http://www.google.com/calendar/feeds/".$this->booking_pending_cal_user."/private/full";					
			
			$this->ph_cal_sg_user_csm = "csm.sg_ha049k6a2qohpe955d9na2gfmk@group.calendar.google.com";
			$this->ph_cal_sg_user_csm_magicCookie = "ca07655fbd4f881722b0ba77b237fe13";
			
			$this->registered_user_gid = 2;
			$this->event_organizer_gid = 9;	
			$this->csm_booking_admin_gid = 10;
			$this->admin_gid = 7;
			$this->manager_gid = 6;	
			$this->super_user_gid = 8;		
			$this->com_url = "seminar-training-facilities/seminar-room-booking.html";
			$this->pp_return = "http://www.csm.sg/portal5/index.php?option=com_csmbol&controller=csmbol&view=csmbol&task=checkReturn";
			$this->pp_cancel = "http://www.csm.sg/portal5/index.php?option=com_csmbol&controller=csmbol&view=csmbol&task=showCancel";		

			$this->booking_cal_info["action_room"] = array("forroom"=>"action_room",
											   "cal_user"=>"csm.sg_jmt3496d2heqlj8gm7du1f9cg0@group.calendar.google.com",
											   "cal_mc"=>"e50efdd8505c37f2923ddafa4bd8d753",
											   "cal_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_jmt3496d2heqlj8gm7du1f9cg0@group.calendar.google.com"."/private/full",
											   "cal_pending_user"=>"csm.sg_61qmjlvbjofnnvt7609lsgbc08@group.calendar.google.com",
											   "cal_pending_mc"=>"9c321f0867e55ced2f520c2e8d96721d",
											   "cal_pending_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_61qmjlvbjofnnvt7609lsgbc08@group.calendar.google.com"."/private/full");
			$this->booking_cal_info["passion_room"] = array("forroom"=>"passion_room",
											   "cal_user"=>"csm.sg_o64pket997d2ug0iiufqhf3r0o@group.calendar.google.com",
											   "cal_mc"=>"6d91352374d62baa3fa065bac3696c9d",
											   "cal_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_o64pket997d2ug0iiufqhf3r0o@group.calendar.google.com"."/private/full",
											   "cal_pending_user"=>"csm.sg_c7ud5v05d9behnfcrjafv29k2o@group.calendar.google.com",
											   "cal_pending_mc"=>"8b67ba6589343d83c1481f873e1c3a52",
											   "cal_pending_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_c7ud5v05d9behnfcrjafv29k2o@group.calendar.google.com"."/private/full");
			$this->booking_cal_info["genius_room"] = array("forroom"=>"genius_room",
											   "cal_user"=>"csm.sg_2blbrufoi519b45k25kag4i298@group.calendar.google.com",
											   "cal_mc"=>"6941153f20d370e46b50e92e41bd1c74",
											   "cal_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_2blbrufoi519b45k25kag4i298@group.calendar.google.com"."/private/full",
											   "cal_pending_user"=>"csm.sg_0be2h9nvqrju1gnmquqvbdfeuo@group.calendar.google.com",
											   "cal_pending_mc"=>"7ac66c8c8817c28c0075df5b427f11df",
											   "cal_pending_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_0be2h9nvqrju1gnmquqvbdfeuo@group.calendar.google.com"."/private/full");												 			$this->booking_cal_info["elite_room"] = array("forroom"=>"elite_room",
											   "cal_user"=>"csm.sg_0hcqtidovmrs2ubr29hb4ots8c@group.calendar.google.com",
											   "cal_mc"=>"c6dc30892470631a12fc2706f2fcd294",
											   "cal_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_0hcqtidovmrs2ubr29hb4ots8c@group.calendar.google.com"."/private/full",
											   "cal_pending_user"=>"csm.sg_ki7uac4crpk41898sgkalpos38@group.calendar.google.com",
											   "cal_pending_mc"=>"f8a53a1d1e74b61261edea6fbb47b44d",
											   "cal_pending_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_ki7uac4crpk41898sgkalpos38@group.calendar.google.com"."/private/full");
 			$this->booking_cal_info["focus_room"] = array("forroom"=>"focus_room",
											   "cal_user"=>"csm.sg_2li9avvfeh3go1fo8d18qkjho0@group.calendar.google.com",
											   "cal_mc"=>"a926d709cb709ed45ffec27bc228caef",
											   "cal_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_2li9avvfeh3go1fo8d18qkjho0@group.calendar.google.com"."/private/full",
											   "cal_pending_user"=>"csm.sg_0k2dueov7v2p6a1f5t57eei9b0@group.calendar.google.com",
											   "cal_pending_mc"=>"d9c6644a033fe0018c97517414ea4ee8",
											   "cal_pending_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_0k2dueov7v2p6a1f5t57eei9b0@group.calendar.google.com"."/private/full");
			$this->booking_cal_info["wisdom_room"] = array("forroom"=>"wisdom_room",
											   "cal_user"=>"csm.sg_i8lb8o8ori1mvcm0f7eq2lr1dg@group.calendar.google.com",
											   "cal_mc"=>"d9c6644a033fe0018c97517414ea4ee8",
											   "cal_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_i8lb8o8ori1mvcm0f7eq2lr1dg@group.calendar.google.com"."/private/full",
											   "cal_pending_user"=>"csm.sg_regvu06he0gptukdplcp4umee4@group.calendar.google.com",
											   "cal_pending_mc"=>"d4c8ca7c1c38f5987de8537fc562f092",
											   "cal_pending_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_regvu06he0gptukdplcp4umee4@group.calendar.google.com"."/private/full");	
			$this->booking_cal_info["harmony_room"] = array("forroom"=>"vision_room",
											   "cal_user"=>"csm.sg_9okj6cftmbpe902mqtq7j3b6vs@group.calendar.google.com",
											   "cal_mc"=>"65fdfc36dbd64a36008b272589b5c34e",
											   "cal_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_9okj6cftmbpe902mqtq7j3b6vs@group.calendar.google.com"."/private/full",
											   "cal_pending_user"=>"csm.sg_dd8s0o0eettmv86ide7p2bc6c4@group.calendar.google.com",
											   "cal_pending_mc"=>"dbb2cc7d61e07ac3358e0ae54bf19bae",
											   "cal_pending_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_dd8s0o0eettmv86ide7p2bc6c4@group.calendar.google.com"."/private/full");	
			$this->booking_cal_info["spirit_room"] = array("forroom"=>"spirit_room",
											   "cal_user"=>"csm.sg_20qtli4s5p2ff24buks6qlu2g0@group.calendar.google.com",
											   "cal_mc"=>"9f2bd50633c04b36d50a3ef074f01038",
											   "cal_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_20qtli4s5p2ff24buks6qlu2g0@group.calendar.google.com"."/private/full",
											   "cal_pending_user"=>"csm.sg_fgraok7k558kpfvv6scvnmag28@group.calendar.google.com",
											   "cal_pending_mc"=>"6c46e5645738fd763f1d44ec0dcd2c63",
											   "cal_pending_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_fgraok7k558kpfvv6scvnmag28@group.calendar.google.com"."/private/full");				  
			
			$this->at_login['csm'] = 'csm1234';
		}else{
			$this->factor = 0.0005;
			$this->client_pending_duration = 6; //seconds;
		
			$this->booking_default_cal_base_user = "testcal@csm.sg";
			$this->booking_default_cal_base_password = "tc1234";
		
			$this->booking_default_cal_user = "csm.sg_f8c3rt64fovfdq18nb6o5ch2ms@group.calendar.google.com";
			$this->booking_default_cal_magicCookie = "43f14c1b10bd621a8937b44646a348b1";		
			$this->booking_pending_cal_user = "csm.sg_0n4i6h6gnoor8r7kl595i3sq2s@group.calendar.google.com";
			$this->booking_pending_cal_magicCookie = "7c41d9057feea743c5797e5d09c65b05";

			$this->ph_cal_sg_user_csm = "csm.sg_pvrbtivdu4f6lervh9dopotjho@group.calendar.google.com";	
			$this->ph_cal_sg_user_csm_magicCookie = "568394e4b37dce3b416a12a9e021eaa1"; 			
				
			//visit this url to get the uri for existing calendars
			//http://www.google.com/calendar/feeds/default/owncalendars/full	
			$this->cal_default_uri = "http://www.google.com/calendar/feeds/".$this->booking_default_cal_user."/private/full";
			$this->cal_pending_uri = "http://www.google.com/calendar/feeds/".$this->booking_pending_cal_user."/private/full";

			$this->ph_cal_sg_user_csm = "csm.sg_pvrbtivdu4f6lervh9dopotjho@group.calendar.google.com";
			$this->ph_cal_sg_user_csm_magicCookie = "568394e4b37dce3b416a12a9e021eaa1";		
			//user management			
			$this->registered_user_gid = 2;			
			$this->event_organizer_gid = 9;
			$this->csm_booking_admin_gid = 10;
			$this->admin_gid = 7;
			$this->manager_gid = 6;	
			$this->super_user_gid = 8;
			$this->com_url = "seminar-training-facilities/seminar-room-booking.html";	
			$this->pp_return = "http://www.csmlive.sg/portal3/index.php?option=com_csmbol&controller=csmbol&view=csmbol&task=checkReturn";
			$this->pp_cancel = "http://www.csmlive.sg/portal3/index.php?option=com_csmbol&controller=csmbol&view=csmbol&task=showCancel";	
			
			$this->booking_cal_info["action_room"] = array("forroom"=>"action_room",
											   "cal_user"=>"csm.sg_fdk3c74n5q11gs7mp4bqbfc0bc@group.calendar.google.com",
											   "cal_mc"=>"b53fb0c73439f5546872b759f9ab8e98",
											   "cal_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_fdk3c74n5q11gs7mp4bqbfc0bc@group.calendar.google.com"."/private/full",
											   "cal_pending_user"=>"csm.sg_9uo4patj020774tovtb8bmo208@group.calendar.google.com",
											   "cal_pending_mc"=>"1758c68de7a7274e50a7ff832682157b",
											   "cal_pending_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_9uo4patj020774tovtb8bmo208@group.calendar.google.com"."/private/full");
			$this->booking_cal_info["passion_room"] = array("forroom"=>"passion_room",
											   "cal_user"=>"csm.sg_m1kqf855psm7mcrdjjgoqdbh7k@group.calendar.google.com",
											   "cal_mc"=>"6b972379080ad986d2ced0c751afbb0c",
											   "cal_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_m1kqf855psm7mcrdjjgoqdbh7k@group.calendar.google.com"."/private/full",
											   "cal_pending_user"=>"csm.sg_t19eceetsjg17dk6g6ah7olp7s@group.calendar.google.com",
											   "cal_pending_mc"=>"cf10bde0ae5e81995f365a9491fad1e8",
											   "cal_pending_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_t19eceetsjg17dk6g6ah7olp7s@group.calendar.google.com"."/private/full");
			$this->booking_cal_info["genius_room"] = array("forroom"=>"genius_room",
											   "cal_user"=>"csm.sg_5787g8neeker4s3b7tq4pib9oo@group.calendar.google.com",
											   "cal_mc"=>"fe4560ebb7a388bbe825d8c30019ec5a",
											   "cal_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_5787g8neeker4s3b7tq4pib9oo@group.calendar.google.com"."/private/full",
											   "cal_pending_user"=>"csm.sg_t19eceetsjg17dk6g6ah7olp7s@group.calendar.google.com",
											   "cal_pending_mc"=>"cf10bde0ae5e81995f365a9491fad1e8",
											   "cal_pending_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_t19eceetsjg17dk6g6ah7olp7s@group.calendar.google.com"."/private/full");	
			$this->booking_cal_info["elite_room"] = array("forroom"=>"elite_room",
											   "cal_user"=>"csm.sg_2hslsu0lg7qt4h9d8peiujk7sc@group.calendar.google.com",
											   "cal_mc"=>"6452151920d0b0752246f2a4435c5738",
											   "cal_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_2hslsu0lg7qt4h9d8peiujk7sc@group.calendar.google.com"."/private/full",
											   "cal_pending_user"=>"csm.sg_5a60n72m8srhm8rmd25p5puh14@group.calendar.google.com",
											   "cal_pending_mc"=>"437f5b9c295053a001474f2a33fdb441",
											   "cal_pending_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_5a60n72m8srhm8rmd25p5puh14@group.calendar.google.com"."/private/full");		
 			$this->booking_cal_info["focus_room"] = array("forroom"=>"focus_room",
											   "cal_user"=>"csm.sg_9kbclbmar0fpa4i1pcevsppd3g@group.calendar.google.com",
											   "cal_mc"=>"5810c6b70c6f15b16b4903da0170ef88",
											   "cal_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_9kbclbmar0fpa4i1pcevsppd3g@group.calendar.google.com"."/private/full",
											   "cal_pending_user"=>"csm.sg_mbfvkfr0s02d7e7ouv99bmcsp8@group.calendar.google.com",
											   "cal_pending_mc"=>"6a988b62051cdf89982af782b3b8bae8",
											   "cal_pending_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_mbfvkfr0s02d7e7ouv99bmcsp8@group.calendar.google.com"."/private/full");													
			$this->booking_cal_info["wisdom_room"] = array("forroom"=>"wisdom_room",
											   "cal_user"=>"csm.sg_c5shltg18lacooqj8ri2gq12v4@group.calendar.google.com",
											   "cal_mc"=>"4888aac59d0007bbabf5039b32870c88",
											   "cal_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_c5shltg18lacooqj8ri2gq12v4@group.calendar.google.com"."/private/full",
											   "cal_pending_user"=>"csm.sg_n7htn2o9jv25h7o619p0lk4upk@group.calendar.google.com",
											   "cal_pending_mc"=>"f0b0823859a43e463ad0a1d77bdea60a",
											   "cal_pending_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_n7htn2o9jv25h7o619p0lk4upk@group.calendar.google.com"."/private/full");	
			$this->booking_cal_info["harmony_room"] = array("forroom"=>"vision_room",
											   "cal_user"=>"csm.sg_o585427i8o78i6stc2tn7gt3u4@group.calendar.google.com",
											   "cal_mc"=>"99298029b821ef74d8299f1a83cf5680",
											   "cal_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_o585427i8o78i6stc2tn7gt3u4@group.calendar.google.com"."/private/full",
											   "cal_pending_user"=>"csm.sg_mlrhcgev4a5o8cmcj0o521djms@group.calendar.google.com",
											   "cal_pending_mc"=>"d8ce241fc8a09f92dd26964f85155d90",
											   "cal_pending_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_mlrhcgev4a5o8cmcj0o521djms@group.calendar.google.com"."/private/full");	
			$this->booking_cal_info["spirit_room"] = array("forroom"=>"spirit_room",
											   "cal_user"=>"csm.sg_bpfa887udmur611h939i8m6kck@group.calendar.google.com",
											   "cal_mc"=>"1805ed58f6626a2afd79512c7df37c3e",
											   "cal_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_bpfa887udmur611h939i8m6kck@group.calendar.google.com"."/private/full",
											   "cal_pending_user"=>"csm.sg_3mue2e70e6jvq0ecagantctrq8@group.calendar.google.com",
											   "cal_pending_mc"=>"5c6e079006b4fce5c0aee6b8caf05d42",
											   "cal_pending_uri"=>"http://www.google.com/calendar/feeds/"."csm.sg_3mue2e70e6jvq0ecagantctrq8@group.calendar.google.com"."/private/full");								   											   											   								   
			//room profile, U/C
			$this->room_profile[0] = array("forroom"=>"action_room",
										   "opt_15min"=>1,
										   "opt_pws"=>1,
										   "opt_so"=>1,
										   "opt_fcwp"=>2,
										   "opt_fcm"=>2,
										   "opt_wb"=>1,
										   "opt_mic_co"=>1,
										   "opt_mic_hh"=>2,
										   "opt_aso"=>1,
										   "opt_ms"=>1,
										   "opt_wic"=>1,
										   "opt_wnt"=>1,
										   "opt_tbl"=>6,
										   "opt_layout"=>1,
										   "opt_ph"=>1);
			$this->room_profile[1] = array("forroom"=>"passion_room",
										   "opt_15min"=>1,
										   "opt_pws"=>1,
										   "opt_so"=>1,
										   "opt_fcwp"=>2,
										   "opt_fcm"=>2,
										   "opt_wb"=>1,
										   "opt_mic_co"=>1,
										   "opt_mic_hh"=>2,
										   "opt_aso"=>1,
										   "opt_ms"=>1,
										   "opt_wic"=>1,
										   "opt_wnt"=>1,
										   "opt_tbl"=>6,
										   "opt_layout"=>1,
										   "opt_ph"=>1);
			$this->room_profile[2] = array("forroom"=>"genius_room",
										   "opt_15min"=>1,
										   "opt_pws"=>1,
										   "opt_so"=>1,
										   "opt_fcwp"=>2,
										   "opt_fcm"=>2,
										   "opt_wb"=>1,
										   "opt_mic_co"=>1,
										   "opt_mic_hh"=>2,
										   "opt_aso"=>1,
										   "opt_ms"=>1,
										   "opt_wic"=>1,
										   "opt_wnt"=>1,
										   "opt_tbl"=>6,
										   "opt_layout"=>1,
										   "opt_ph"=>1);										   
			$this->room_profile[3] = array("forroom"=>"elite_room",
										   "opt_15min"=>1,
										   "opt_pws"=>1,
										   "opt_so"=>1,
										   "opt_fcwp"=>2,
										   "opt_fcm"=>2,
										   "opt_wb"=>1,
										   "opt_mic_co"=>1,
										   "opt_mic_hh"=>2,
										   "opt_aso"=>1,
										   "opt_ms"=>1,
										   "opt_wic"=>1,
										   "opt_wnt"=>1,
										   "opt_tbl"=>6,
										   "opt_layout"=>1,
										   "opt_ph"=>1);			
			
			$this->at_login['staff'] = '111';									
		}
		
		$this->rates = array();
		//$factor and $this->factor are not the same
		$this->rates['action_room']['rate_weekday_am'] = 128*$this->factor;
		$this->rates['action_room']['rate_weekday_pm'] = 128*$this->factor;
		$this->rates['action_room']['rate_weekday_ev'] = 168*$this->factor;
		$this->rates['action_room']['rate_weekend_am'] = 168*$this->factor;
		$this->rates['action_room']['rate_weekend_pm'] = 168*$this->factor;
		$this->rates['action_room']['rate_weekend_ev'] = 168*$this->factor;
		//special
		$this->rates['action_room']['rate_mon_am'] = 128*$this->factor;
		$this->rates['action_room']['rate_tue_am'] = 128*$this->factor;
		$this->rates['action_room']['rate_wed_am'] = 128*$this->factor;
		$this->rates['action_room']['rate_thu_am'] = 128*$this->factor;
		$this->rates['action_room']['rate_fri_am'] = 128*$this->factor;
		$this->rates['action_room']['rate_sat_am'] = 168*$this->factor;
		$this->rates['action_room']['rate_sun_am'] = 168*$this->factor;	
		
		$this->rates['action_room']['rate_mon_pm'] = 128*$this->factor;
		$this->rates['action_room']['rate_tue_pm'] = 128*$this->factor;
		$this->rates['action_room']['rate_wed_pm'] = 128*$this->factor;
		$this->rates['action_room']['rate_thu_pm'] = 128*$this->factor;
		$this->rates['action_room']['rate_fri_pm'] = 128*$this->factor;
		$this->rates['action_room']['rate_sat_pm'] = 188*$this->factor;
		$this->rates['action_room']['rate_sun_pm'] = 168*$this->factor;							
		
		$this->rates['action_room']['rate_mon_ev'] = 168*$this->factor;
		$this->rates['action_room']['rate_tue_ev'] = 168*$this->factor;
		$this->rates['action_room']['rate_wed_ev'] = 168*$this->factor;
		$this->rates['action_room']['rate_thu_ev'] = 168*$this->factor;
		$this->rates['action_room']['rate_fri_ev'] = 168*$this->factor;
		$this->rates['action_room']['rate_sat_ev'] = 168*$this->factor;
		$this->rates['action_room']['rate_sun_ev'] = 168*$this->factor;						
					
		$base_rate_passion_room = 118;
		$this->rates['passion_room']['rate_weekday_am'] = $base_rate_passion_room*$this->factor;
		$this->rates['passion_room']['rate_weekday_pm'] = $base_rate_passion_room*$this->factor;
		$this->rates['passion_room']['rate_weekday_ev'] = 128*$this->factor;
		$this->rates['passion_room']['rate_weekend_am'] = 128*$this->factor;
		$this->rates['passion_room']['rate_weekend_pm'] = 128*$this->factor;
		$this->rates['passion_room']['rate_weekend_ev'] = 128*$this->factor;
		//special
		$this->rates['passion_room']['rate_mon_am'] = $base_rate_passion_room*$this->factor;
		$this->rates['passion_room']['rate_tue_am'] = $base_rate_passion_room*$this->factor;
		$this->rates['passion_room']['rate_wed_am'] = $base_rate_passion_room*$this->factor;
		$this->rates['passion_room']['rate_thu_am'] = $base_rate_passion_room*$this->factor;
		$this->rates['passion_room']['rate_fri_am'] = $base_rate_passion_room*$this->factor;
		$this->rates['passion_room']['rate_sat_am'] = 128*$this->factor;
		$this->rates['passion_room']['rate_sun_am'] = 128*$this->factor;	
		
		$this->rates['passion_room']['rate_mon_pm'] = $base_rate_passion_room*$this->factor;
		$this->rates['passion_room']['rate_tue_pm'] = $base_rate_passion_room*$this->factor;
		$this->rates['passion_room']['rate_wed_pm'] = $base_rate_passion_room*$this->factor;
		$this->rates['passion_room']['rate_thu_pm'] = $base_rate_passion_room*$this->factor;
		$this->rates['passion_room']['rate_fri_pm'] = $base_rate_passion_room*$this->factor;
		$this->rates['passion_room']['rate_sat_pm'] = 148*$this->factor;
		$this->rates['passion_room']['rate_sun_pm'] = 128*$this->factor;							
		
		$this->rates['passion_room']['rate_mon_ev'] = 128*$this->factor;
		$this->rates['passion_room']['rate_tue_ev'] = 128*$this->factor;
		$this->rates['passion_room']['rate_wed_ev'] = 128*$this->factor;
		$this->rates['passion_room']['rate_thu_ev'] = 128*$this->factor;
		$this->rates['passion_room']['rate_fri_ev'] = 128*$this->factor;
		$this->rates['passion_room']['rate_sat_ev'] = 128*$this->factor;
		$this->rates['passion_room']['rate_sun_ev'] = 128*$this->factor;						

		$base_rate_genius_room = 130;
		$this->rates['genius_room']['rate_weekday_am'] = $base_rate_genius_room*$this->factor;
		$this->rates['genius_room']['rate_weekday_pm'] = $base_rate_genius_room*$this->factor;
		$this->rates['genius_room']['rate_weekday_ev'] = 150*$this->factor;
		$this->rates['genius_room']['rate_weekend_am'] = 150*$this->factor;
		$this->rates['genius_room']['rate_weekend_pm'] = 150*$this->factor;
		$this->rates['genius_room']['rate_weekend_ev'] = 150*$this->factor;
		
		$this->rates['genius_room']['rate_mon_am'] = $base_rate_genius_room*$this->factor;
		$this->rates['genius_room']['rate_tue_am'] = $base_rate_genius_room*$this->factor;
		$this->rates['genius_room']['rate_wed_am'] = $base_rate_genius_room*$this->factor;
		$this->rates['genius_room']['rate_thu_am'] = $base_rate_genius_room*$this->factor;
		$this->rates['genius_room']['rate_fri_am'] = $base_rate_genius_room*$this->factor;
		$this->rates['genius_room']['rate_sat_am'] = 150*$this->factor;
		$this->rates['genius_room']['rate_sun_am'] = 150*$this->factor;	
		
		$this->rates['genius_room']['rate_mon_pm'] = $base_rate_genius_room*$this->factor;
		$this->rates['genius_room']['rate_tue_pm'] = $base_rate_genius_room*$this->factor;
		$this->rates['genius_room']['rate_wed_pm'] = $base_rate_genius_room*$this->factor;
		$this->rates['genius_room']['rate_thu_pm'] = $base_rate_genius_room*$this->factor;
		$this->rates['genius_room']['rate_fri_pm'] = $base_rate_genius_room*$this->factor;
		$this->rates['genius_room']['rate_sat_pm'] = 170*$this->factor;
		$this->rates['genius_room']['rate_sun_pm'] = 150*$this->factor;							
		
		$this->rates['genius_room']['rate_mon_ev'] = 150*$this->factor;
		$this->rates['genius_room']['rate_tue_ev'] = 150*$this->factor;
		$this->rates['genius_room']['rate_wed_ev'] = 150*$this->factor;
		$this->rates['genius_room']['rate_thu_ev'] = 150*$this->factor;
		$this->rates['genius_room']['rate_fri_ev'] = 150*$this->factor;
		$this->rates['genius_room']['rate_sat_ev'] = 150*$this->factor;
		$this->rates['genius_room']['rate_sun_ev'] = 150*$this->factor;					

		$base_rate_elite_room = 110;
		$this->rates['elite_room']['rate_weekday_am'] = $base_rate_elite_room*$this->factor;
		$this->rates['elite_room']['rate_weekday_pm'] = $base_rate_elite_room*$this->factor;
		$this->rates['elite_room']['rate_weekday_ev'] = 130*$this->factor;
		$this->rates['elite_room']['rate_weekend_am'] = 130*$this->factor;
		$this->rates['elite_room']['rate_weekend_pm'] = 130*$this->factor;
		$this->rates['elite_room']['rate_weekend_ev'] = 130*$this->factor;
		
		$this->rates['elite_room']['rate_mon_am'] = $base_rate_elite_room*$this->factor;
		$this->rates['elite_room']['rate_tue_am'] = $base_rate_elite_room*$this->factor;
		$this->rates['elite_room']['rate_wed_am'] = $base_rate_elite_room*$this->factor;
		$this->rates['elite_room']['rate_thu_am'] = $base_rate_elite_room*$this->factor;
		$this->rates['elite_room']['rate_fri_am'] = $base_rate_elite_room*$this->factor;
		$this->rates['elite_room']['rate_sat_am'] = 130*$this->factor;
		$this->rates['elite_room']['rate_sun_am'] = 130*$this->factor;	
		
		$this->rates['elite_room']['rate_mon_pm'] = $base_rate_elite_room*$this->factor;
		$this->rates['elite_room']['rate_tue_pm'] = $base_rate_elite_room*$this->factor;
		$this->rates['elite_room']['rate_wed_pm'] = $base_rate_elite_room*$this->factor;
		$this->rates['elite_room']['rate_thu_pm'] = $base_rate_elite_room*$this->factor;
		$this->rates['elite_room']['rate_fri_pm'] = $base_rate_elite_room*$this->factor;
		$this->rates['elite_room']['rate_sat_pm'] = 150*$this->factor;
		$this->rates['elite_room']['rate_sun_pm'] = 130*$this->factor;							
		
		$this->rates['elite_room']['rate_mon_ev'] = 130*$this->factor;
		$this->rates['elite_room']['rate_tue_ev'] = 130*$this->factor;
		$this->rates['elite_room']['rate_wed_ev'] = 130*$this->factor;
		$this->rates['elite_room']['rate_thu_ev'] = 130*$this->factor;
		$this->rates['elite_room']['rate_fri_ev'] = 130*$this->factor;
		$this->rates['elite_room']['rate_sat_ev'] = 130*$this->factor;
		$this->rates['elite_room']['rate_sun_ev'] = 130*$this->factor;				

		$base_rate_focus_room = 100;
		$this->rates['focus_room']['rate_weekday_am'] = $base_rate_focus_room*$this->factor;
		$this->rates['focus_room']['rate_weekday_pm'] = $base_rate_focus_room*$this->factor;
		$this->rates['focus_room']['rate_weekday_ev'] = 110*$this->factor;
		$this->rates['focus_room']['rate_weekend_am'] = 110*$this->factor;
		$this->rates['focus_room']['rate_weekend_pm'] = 110*$this->factor;
		$this->rates['focus_room']['rate_weekend_ev'] = 110*$this->factor;
		
		$this->rates['focus_room']['rate_mon_am'] = $base_rate_focus_room*$this->factor;
		$this->rates['focus_room']['rate_tue_am'] = $base_rate_focus_room*$this->factor;
		$this->rates['focus_room']['rate_wed_am'] = $base_rate_focus_room*$this->factor;
		$this->rates['focus_room']['rate_thu_am'] = $base_rate_focus_room*$this->factor;
		$this->rates['focus_room']['rate_fri_am'] = $base_rate_focus_room*$this->factor;
		$this->rates['focus_room']['rate_sat_am'] = 110*$this->factor;
		$this->rates['focus_room']['rate_sun_am'] = 110*$this->factor;	
		
		$this->rates['focus_room']['rate_mon_pm'] = $base_rate_focus_room*$this->factor;
		$this->rates['focus_room']['rate_tue_pm'] = $base_rate_focus_room*$this->factor;
		$this->rates['focus_room']['rate_wed_pm'] = $base_rate_focus_room*$this->factor;
		$this->rates['focus_room']['rate_thu_pm'] = $base_rate_focus_room*$this->factor;
		$this->rates['focus_room']['rate_fri_pm'] = $base_rate_focus_room*$this->factor;
		$this->rates['focus_room']['rate_sat_pm'] = 130*$this->factor;
		$this->rates['focus_room']['rate_sun_pm'] = 110*$this->factor;							
		
		$this->rates['focus_room']['rate_mon_ev'] = 110*$this->factor;
		$this->rates['focus_room']['rate_tue_ev'] = 110*$this->factor;
		$this->rates['focus_room']['rate_wed_ev'] = 110*$this->factor;
		$this->rates['focus_room']['rate_thu_ev'] = 110*$this->factor;
		$this->rates['focus_room']['rate_fri_ev'] = 110*$this->factor;
		$this->rates['focus_room']['rate_sat_ev'] = 110*$this->factor;
		$this->rates['focus_room']['rate_sun_ev'] = 110*$this->factor;				

		$base_rate_wisdom_room = 110;
		$this->rates['wisdom_room']['rate_weekday_am'] = $base_rate_wisdom_room*$this->factor;
		$this->rates['wisdom_room']['rate_weekday_pm'] = $base_rate_wisdom_room*$this->factor;
		$this->rates['wisdom_room']['rate_weekday_ev'] = 120*$this->factor;
		$this->rates['wisdom_room']['rate_weekend_am'] = 120*$this->factor;
		$this->rates['wisdom_room']['rate_weekend_pm'] = 120*$this->factor;
		$this->rates['wisdom_room']['rate_weekend_ev'] = 120*$this->factor;
		
		$this->rates['wisdom_room']['rate_mon_am'] = $base_rate_wisdom_room*$this->factor;
		$this->rates['wisdom_room']['rate_tue_am'] = $base_rate_wisdom_room*$this->factor;
		$this->rates['wisdom_room']['rate_wed_am'] = $base_rate_wisdom_room*$this->factor;
		$this->rates['wisdom_room']['rate_thu_am'] = $base_rate_wisdom_room*$this->factor;
		$this->rates['wisdom_room']['rate_fri_am'] = $base_rate_wisdom_room*$this->factor;
		$this->rates['wisdom_room']['rate_sat_am'] = 120*$this->factor;
		$this->rates['wisdom_room']['rate_sun_am'] = 120*$this->factor;	
		
		$this->rates['wisdom_room']['rate_mon_pm'] = $base_rate_wisdom_room*$this->factor;
		$this->rates['wisdom_room']['rate_tue_pm'] = $base_rate_wisdom_room*$this->factor;
		$this->rates['wisdom_room']['rate_wed_pm'] = $base_rate_wisdom_room*$this->factor;
		$this->rates['wisdom_room']['rate_thu_pm'] = $base_rate_wisdom_room*$this->factor;
		$this->rates['wisdom_room']['rate_fri_pm'] = $base_rate_wisdom_room*$this->factor;
		$this->rates['wisdom_room']['rate_sat_pm'] = 120*$this->factor;
		$this->rates['wisdom_room']['rate_sun_pm'] = 120*$this->factor;							
		
		$this->rates['wisdom_room']['rate_mon_ev'] = 120*$this->factor;
		$this->rates['wisdom_room']['rate_tue_ev'] = 120*$this->factor;
		$this->rates['wisdom_room']['rate_wed_ev'] = 120*$this->factor;
		$this->rates['wisdom_room']['rate_thu_ev'] = 120*$this->factor;
		$this->rates['wisdom_room']['rate_fri_ev'] = 120*$this->factor;
		$this->rates['wisdom_room']['rate_sat_ev'] = 120*$this->factor;
		$this->rates['wisdom_room']['rate_sun_ev'] = 120*$this->factor;				

		$base_rate_harmony_room = 80;
		$this->rates['harmony_room']['rate_weekday_am'] = $base_rate_harmony_room*$this->factor;
		$this->rates['harmony_room']['rate_weekday_pm'] = $base_rate_harmony_room*$this->factor;
		$this->rates['harmony_room']['rate_weekday_ev'] = $base_rate_harmony_room*$this->factor;
		$this->rates['harmony_room']['rate_weekend_am'] = $base_rate_harmony_room*$this->factor;
		$this->rates['harmony_room']['rate_weekend_pm'] = $base_rate_harmony_room*$this->factor;
		$this->rates['harmony_room']['rate_weekend_ev'] = $base_rate_harmony_room*$this->factor;
		
		$this->rates['harmony_room']['rate_mon_am'] = $base_rate_harmony_room*$this->factor;
		$this->rates['harmony_room']['rate_tue_am'] = $base_rate_harmony_room*$this->factor;
		$this->rates['harmony_room']['rate_wed_am'] = $base_rate_harmony_room*$this->factor;
		$this->rates['harmony_room']['rate_thu_am'] = $base_rate_harmony_room*$this->factor;
		$this->rates['harmony_room']['rate_fri_am'] = $base_rate_harmony_room*$this->factor;
		$this->rates['harmony_room']['rate_sat_am'] = $base_rate_harmony_room*$this->factor;
		$this->rates['harmony_room']['rate_sun_am'] = $base_rate_harmony_room*$this->factor;	
		
		$this->rates['harmony_room']['rate_mon_pm'] = $base_rate_harmony_room*$this->factor;
		$this->rates['harmony_room']['rate_tue_pm'] = $base_rate_harmony_room*$this->factor;
		$this->rates['harmony_room']['rate_wed_pm'] = $base_rate_harmony_room*$this->factor;
		$this->rates['harmony_room']['rate_thu_pm'] = $base_rate_harmony_room*$this->factor;
		$this->rates['harmony_room']['rate_fri_pm'] = $base_rate_harmony_room*$this->factor;
		$this->rates['harmony_room']['rate_sat_pm'] = $base_rate_harmony_room*$this->factor;
		$this->rates['harmony_room']['rate_sun_pm'] = $base_rate_harmony_room*$this->factor;							
		
		$this->rates['harmony_room']['rate_mon_ev'] = $base_rate_harmony_room*$this->factor;
		$this->rates['harmony_room']['rate_tue_ev'] = $base_rate_harmony_room*$this->factor;
		$this->rates['harmony_room']['rate_wed_ev'] = $base_rate_harmony_room*$this->factor;
		$this->rates['harmony_room']['rate_thu_ev'] = $base_rate_harmony_room*$this->factor;
		$this->rates['harmony_room']['rate_fri_ev'] = $base_rate_harmony_room*$this->factor;
		$this->rates['harmony_room']['rate_sat_ev'] = $base_rate_harmony_room*$this->factor;
		$this->rates['harmony_room']['rate_sun_ev'] = $base_rate_harmony_room*$this->factor;				

		$base_rate_spirit_room = 120;
		$this->rates['spirit_room']['rate_weekday_am'] = $base_rate_spirit_room*$this->factor;
		$this->rates['spirit_room']['rate_weekday_pm'] = $base_rate_spirit_room*$this->factor;
		$this->rates['spirit_room']['rate_weekday_ev'] = $base_rate_spirit_room*$this->factor;
		$this->rates['spirit_room']['rate_weekend_am'] = $base_rate_spirit_room*$this->factor;
		$this->rates['spirit_room']['rate_weekend_pm'] = $base_rate_spirit_room*$this->factor;
		$this->rates['spirit_room']['rate_weekend_ev'] = $base_rate_spirit_room*$this->factor;
		
		$this->rates['spirit_room']['rate_mon_am'] = $base_rate_spirit_room*$this->factor;
		$this->rates['spirit_room']['rate_tue_am'] = $base_rate_spirit_room*$this->factor;
		$this->rates['spirit_room']['rate_wed_am'] = $base_rate_spirit_room*$this->factor;
		$this->rates['spirit_room']['rate_thu_am'] = $base_rate_spirit_room*$this->factor;
		$this->rates['spirit_room']['rate_fri_am'] = $base_rate_spirit_room*$this->factor;
		$this->rates['spirit_room']['rate_sat_am'] = $base_rate_spirit_room*$this->factor;
		$this->rates['spirit_room']['rate_sun_am'] = $base_rate_spirit_room*$this->factor;	
		
		$this->rates['spirit_room']['rate_mon_pm'] = $base_rate_spirit_room*$this->factor;
		$this->rates['spirit_room']['rate_tue_pm'] = $base_rate_spirit_room*$this->factor;
		$this->rates['spirit_room']['rate_wed_pm'] = $base_rate_spirit_room*$this->factor;
		$this->rates['spirit_room']['rate_thu_pm'] = $base_rate_spirit_room*$this->factor;
		$this->rates['spirit_room']['rate_fri_pm'] = $base_rate_spirit_room*$this->factor;
		$this->rates['spirit_room']['rate_sat_pm'] = $base_rate_spirit_room*$this->factor;
		$this->rates['spirit_room']['rate_sun_pm'] = $base_rate_spirit_room*$this->factor;							
		
		$this->rates['spirit_room']['rate_mon_ev'] = $base_rate_spirit_room*$this->factor;
		$this->rates['spirit_room']['rate_tue_ev'] = $base_rate_spirit_room*$this->factor;
		$this->rates['spirit_room']['rate_wed_ev'] = $base_rate_spirit_room*$this->factor;
		$this->rates['spirit_room']['rate_thu_ev'] = $base_rate_spirit_room*$this->factor;
		$this->rates['spirit_room']['rate_fri_ev'] = $base_rate_spirit_room*$this->factor;
		$this->rates['spirit_room']['rate_sat_ev'] = $base_rate_spirit_room*$this->factor;
		$this->rates['spirit_room']['rate_sun_ev'] = $base_rate_spirit_room*$this->factor;				

		//timing options
		$this->rates['rate_opt_15min'] = 5*$this->factor; //extention time
		//visual options
		$this->rates['rate_opt_pws'] = 18*$this->factor; //projector with screen
		$this->rates['rate_opt_so'] = 10*$this->factor; //screen only
		$this->rates['rate_opt_fcwp'] = 15*$this->factor; //flipchart with paper
		$this->rates['rate_opt_fcm'] = 10*$this->factor; //flipchart marker
		$this->rates['rate_opt_wb'] = 10*$this->factor; //white board wiht marker
		//audio options
		$this->rates['rate_opt_mic_co'] = 20*$this->factor; //mic clip-on with audio system
		$this->rates['rate_opt_mic_hh'] = 15*$this->factor; //mic hand-held with audio system
		$this->rates['rate_opt_aso'] = 10*$this->factor; //audio system only
		$this->rates['rate_opt_ms'] = 5*$this->factor;	//mic stand	
		//connection options
		$this->rates['rate_opt_wic'] = 10*$this->factor; //wireless internet connection
		$this->rates['rate_opt_wnt'] = 10*$this->factor; //wireless NETS terminal
		//layout options
		$this->rates['rate_opt_tbl'] = 5*$this->factor; //table
		$this->rates['rate_opt_layout'] = 10*$this->factor; //layout
		//public holiday
		$this->rates['rate_opt_ph'] = 10*$this->factor;		
		
		$this->rates['rate_surcharge'] = 0.02;		 
	}
	
	function &Instance( $params = array()){
		$i = new csmbolGlobalConf( $params );
		return $i;
	}
	
	function wrapMsg($msg, $class){
		return "<div class=\"".$class."\">".$msg."</div>";
	}
}